<?php

class PromotionController extends HBaseController
{
	//设置导航焦点
	public $active_cur = 'promotion';
	
	/**
	 * 限时抢购首页
	 */
	public function actionIndex()
	{
		$this->render('index');
	}

	/**
	 * 限时抢购列表页
	 */
	public function actionList($id){
		$model = new ProTuan('search');
		$model->unsetAttributes();//清空属性
		$model->zpt_status = 2;//审核状态为通过
		$model->zpt_type = 2;//类型:1:团购2:秒杀3:限量抢购
		$model->category_top = $id;//一级行业分类
		$model->zpt_end_time = '>'.time();//结束时间大于当前时间
		$model->zpt_close = 1;//是否关闭1否2是3删除
		
		if(isset($_GET['ProTuan'])){
			$model->attributes = $_GET['ProTuan'];
		}
		
		$this->render('list',array(
				'model'=>$model,
		));
	}
}